package net.sudot.chess.business.wechat.handler;

import me.chanjar.weixin.common.session.WxSessionManager;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
import net.sudot.commons.json.JsonUtils;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * 微信请求日志记录
 *
 * @author tangjialin on 2017-05-04 0004.
 */
@Component
public class LogHandler extends AbstractHandler {

    @Override
    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
                                    Map<String, Object> context, WxMpService wxMpService,
                                    WxSessionManager sessionManager) {
        if (debugEnabled) {
            logger.debug("接收到请求消息，内容：{}", JsonUtils.toJson(wxMessage));
        }
        return null;
    }

}
